<style>
.content-group {background:#fff;border-radius: 0.5rem;margin-bottom:0.39rem}
.fui-tab-scroll .item.on:before {background:linear-gradient(to right,rgba(99,190,114,1),rgba(99,190,114,0));}
</style>
<div class="fui-page shop-index-page" style="display:block;">
    <div class="fui-content" style="padding-bottom:4rem">
		<div style="background:#fff">
		<div class="fui-cell-group fui-cell-click" style="padding:0 0.3rem;margin-top: 0;margin-bottom:0.2rem">
			<div class="fui-cellone" style="padding:0.3rem 0.1rem;top:0;">
				 <div class="fui-cellone-info">
					<div class="search-input" style="height:1.6rem">
						<form action="javascript:return true">
						<i id="searchsub" class="icon icon-sousuo1 bold" ng-click="tool.get_list('jy_kecheng/index/getlist/',true)" style="line-height: 1.7rem;"></i>
						<input type="search" placeholder="搜索课程" class="search" ng-model="pagedata.params.keyword" style="height:1.6rem;border: 0;text-align: left; color: #999; font-size:0.6rem;background:#f2f2f2;border-radius: 1rem;" />
						</form>
					</div>
				 </div>
				 <div class="fui-cellone-remark noremark">
					<span style="margin-left:0.3rem;font-size: 0.75rem;" ng-click="tool.get_list('jy_kecheng/index/getlist/',true)">搜索</span>
				 </div>
			</div>
		</div>
		<!-- 滚动后出现 -->
		<div ng-if="showtopheader" class="searchtop" style="padding:0 0.3rem;background:#fff">
		<div class="fui-cellone" style="padding:0.3rem 0.1rem;top:0;">
				 <div class="fui-cellone-info">
					<div class="search-input" style="height:1.6rem">
						<form action="javascript:return true">
						<i id="searchsub" class="icon icon-sousuo1 bold" ng-click="tool.get_list('jy_kecheng/index/getlist/',true)" style="line-height: 1.7rem;"></i>
						<input type="search" placeholder="搜索课程" class="search" ng-model="pagedata.params.keyword" style="height:1.6rem;border: 0;text-align: left; color: #999; font-size:0.6rem;background:#f2f2f2;border-radius: 1rem;" />
						</form>
					</div>
				 </div>
				 <div class="fui-cellone-remark noremark">
					<span style="margin-left:0.3rem;font-size: 0.75rem;" ng-click="tool.get_list('jy_kecheng/index/getlist/',true)">搜索</span>
				 </div>
		</div>
		</div>
		</div>
		<div class="fui-fullHigh-group" style="overflow-y:scroll;height:30rem">
			<div class="fui-fullHigh-item menu" id="tab">
				<nav ng-repeat="(k,value) in pagedata.groups" ng-click="pagedata.getgoods($index)" ng-class="{'on':pagedata.params.pcate == value.id}">{{value.title}}</nav>
			</div>
			<div class="fui-fullHigh-item container" style="position: relative">
				<a id="advurl" class="swipe external" ng-show="pagedata.image" href="javascript:" ng-click="access_json(pagedata.advurl)" >
					<img id="advimg" ng-src="{{tomedia(pagedata.image) || '../core/resource/images/nopic.jpg'}}">
				</a>
				<div id="container">
				<div ng-if="pagedata.nowchilds.length>0" style="margin-top:0.2rem;">
					<div style="overflow-x:scroll;white-space:nowrap;height:1.4rem">
						<span ng-repeat="c in pagedata.nowchilds" ng-class="{'jylabel jylabel-red-0':1,'active':pagedata.nowchildid == c.id}" ng-click="pagedata.getnowchilds($index);" style="margin-right:0.3rem;border-radius: 1rem;">{{c.title}}</span>
					</div>
				</div>				
				<div class="fui-goods-group container no" style="margin-top:0.2rem">
						<div ng-repeat="item in pagedata.list" class="fui-goods-item" style="padding:0.5rem 0">
							<div ng-click="access_json('jy_kecheng/video_jie//id='+item.id)" class="image" style="background-image: url({{tomedia(item.thumb)}})">
							</div>
							<div class="detail" style="height:auto">
								<div class="name overflow-h2 bold">
										{{item.title}}
								</div>
								<div class="fui-tag fui-tag-danger" style="background:linear-gradient(to right,rgba(244,221,187,0.6),rgba(235,216,174,1));color:#512f0a;width:auto;font-weight:400">{{item.typetitle}}</div>
								<div class="price" style="">
									<span class="member"><img ng-repeat="m in item.members" ng-if="$index<=5" class="avatar" style="margin-right:-0.3rem" ng-src="{{tomedia(m.avatar) || '../core/resource/images/nopic.jpg'}}"></span>
									<div class="subtitle" style="font-weight:400"><i class="icon icon-good"></i> {{item.likes || 0}} <i class="icon icon-browse"></i> {{item.readnum || 0}}</div>
								</div>
							</div>
						</div>
				</div>
				<div ng-if="pagedata.loading" class='infinite-loading'><span class='fui-preloader'></span><span class='text'> 正在加载...</span></div>
				<div ng-if="!pagedata.loading" class='content-empty' style="margin-top:0">
						<div ng-if="pagedata.nowchilds.length>0 && (!pagedata.list || pagedata.list.length<1)">
							<i class='icon icon-cry'></i><br/>该分类,没有任何课程！
						</div>
						<div ng-if="(!pagedata.nowchilds || pagedata.nowchilds.length<1) && (!pagedata.list || pagedata.list.length<1)">
							<i class='icon icon-cry'></i><br/>该分类,没有任何课程！
						</div>
				</div>
			</div>
		</div>
		</div>
		<div ng-if="pagedata.loading" class='infinite-loading'><span class='fui-preloader'></span><span style="margin-left:1.5rem"> 正在加载...</span></div>
	</div>
</div>
<div ng-if="pagedata.showewm" class="popup">
	<div class="popup-body">
		<div class="popup-bottom">
			<i class="closed icon icon-cuowu" ng-click="pagedata.showewm=false"></i>
			<div class="fui-icon-group noborder col-5" style="padding-top:0.5rem">
				 <div class="fui-list">
					<div class="fui-card" style="margin-left:auto;margin-right:auto;padding-top:0;border-radius:0.5rem">
						<img style="width:8rem;height:8rem;border-radius:0.5rem" src="{{tomedia(pagedata.showitem.ewm) || '../addons/jy_kecheng/resource/img/code.png'}}"  />
					</div>
				</div>
				<div class="fui-line-title">
					<div class="text text-danger bold" style="margin-bottom: -8px;">———— *  <span style=";font-size:13px">微信扫上面二维码</span> * ————</div>
				</div>
			</div>
		</div>
	</div>
</div>
<div ng-include="sys_html('_footer')"></div>
<div ng-include="sys_html('common/_gotop',true)"></div>
<script>
scope.pagedata.setshowewm=function(item){
	scope.post_json('/index/looklog/id='+item.id,{},function(res){
		if(res=='success'){
			
		}
	});
}
require(['bootstrap', 'hammer'], function($, Hammer){
		$('#carousel-container').carousel();
		var mc = new Hammer($('#carousel-container').get(0));
		mc.on("panleft", function(ev) {
			$('#carousel-container').carousel('next');
		});
		mc.on("panright", function(ev) {
			$('#carousel-container').carousel('prev');
		});
});
scope.pagedata.getgoods=function(index){
	scope.pagedata.nowckey = index; 
	scope.pagedata.groups[index]=scope.pagedata.groups[index]?scope.pagedata.groups[index]:{'title':'全部'}
	scope.pagedata.nowchilds=scope.pagedata.groups[index].childs;
	scope.pagedata.image=scope.pagedata.groups[index].advimg;
	scope.pagedata.advurl=scope.pagedata.groups[index].advurl;
	scope.pagedata.params.pcate=scope.pagedata.groups[index].id
	scope.pagedata.nowchilds=scope.pagedata.nowchilds?scope.pagedata.nowchilds:{}
	if(scope.pagedata.nowchilds.length>0){
		scope.pagedata.nowchildid=scope.pagedata.nowchilds[0].id
		scope.pagedata.params.ccate=scope.pagedata.nowchilds[0].id
	}else{
		scope.pagedata.nowchildid=0
		scope.pagedata.params.ccate=0
	}
	scope.pagedata.list=[];
	scope.tool.get_list('jy_kecheng/index/getlist/',true);
}
scope.pagedata.getnowchilds=function(index){
	scope.pagedata.params.ccate=scope.pagedata.nowchilds[index].id
	scope.pagedata.nowchildid = scope.pagedata.nowchilds[index].id
	scope.pagedata.list=[];
	scope.tool.get_list('jy_kecheng/index/getlist/',true);
}
//滚动加载
scope.tool.get_list('jy_kecheng/index/getlist/',true);
scope.pagedata.scroll_bottom=function(){
	scope.tool.get_list('jy_kecheng/index/getlist/');
}
//手机软键盘--搜索
$("body").keydown(function() {
    if (event.keyCode == "13") {
        $('#searchsub').click();
    }
});
</script>